package com.cloud.controller.demo;

import com.alibaba.excel.EasyExcel;
import com.cloud.controller.from.file.ResourceFrom;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RequestMapping("/excel")
@RestController
public class ExcelController {

    @RequestMapping("/download")
    public void download(ResourceFrom resourceFrom) throws Exception {


        List<Object> lists = EasyExcel.read(resourceFrom.getFiles()[0].getInputStream(),ImportCabinetForm.class,null).sheet(0).doReadSync();
        for (Object l:lists) {
            ImportCabinetForm importCabinetForm = (ImportCabinetForm)l;
            System.out.println(importCabinetForm.sn);

        }


    }
}
